package iO.J20240415;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: nn
 * Date: 2025-05-06
 * Time: 下午5:01
 */
public class Demo1 {
    public static void main(String[] args) throws IOException {
//        File f = new File("d:/test.txt");
        File f = new File("./test.txt");
        System.out.println(f.getParent());//返回 File 对象的⽗⽬录⽂件路径
        System.out.println(f.getName());//返回 FIle 对象的纯⽂件名称
        System.out.println(f.getPath());//返回 File 对象的⽂件路径
        System.out.println(f.getAbsolutePath());//返回 File 对象的绝对路径
        System.out.println(f.getCanonicalFile());//返回 File 对象的修饰过的绝对路径
    }
}
